package com.lwj.model.administration;


import com.lwj.annotation.SensitiveEntity;
import com.lwj.annotation.SensitiveField;
import com.lwj.model.AuditModel;
import com.lwj.utils.DateUtils;
import org.springframework.data.annotation.Id;

import java.io.Serializable;
import java.util.Date;

/**
 * user
 * @author
 */
@SensitiveEntity
public class User extends AuditModel implements Serializable {

    private String empId;
    @SensitiveField
    private String name;
    @SensitiveField
    private String password;
    private String departmentId;
    /**
     * 状态标识:1表示启用;2表示禁用
     */
    private Integer enableState;

    /**
     * 性别
     */
    private String gender;

    /**
     * 生日
     */
    private String birthDate;

    /**
     * 年龄
     */
    private Integer age;

    /**
     * 手机号码
     */
    private String mobile;


    public String getDepartmentId() {
        return departmentId;
    }

    public void setDepartmentId(String departmentId) {
        this.departmentId = departmentId;
    }

    private static final long serialVersionUID = 1L;

    public String getEmpId() {
        return empId;
    }

    public void setEmpId(String empId) {
        this.empId = empId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public Integer getEnableState() {
        return enableState;
    }

    public void setEnableState(Integer enableState) {
        this.enableState = enableState;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    public String getBirthDate() {
        return birthDate;
    }

    public void setBirthDate(String birthDate) {
        this.birthDate = birthDate;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }
    public void create(String empId){
        String s = DateUtils.DateToString(new Date(), DateUtils.DATE_TO_STRING_DETAIAL_PATTERN);
        this.setCreator(empId);
        this.setCreateTime(s);
        this.setUpdateBy(empId);
        this.setCreateTime(s);
        this.setDr("0");

    }

    @Override
    public String toString() {
        return "User{" +
                "empId='" + empId + '\'' +
                ", name='" + name + '\'' +
                ", password='" + password + '\'' +
                ", departmentId='" + departmentId + '\'' +
                ", enableState=" + enableState +
                ", gender='" + gender + '\'' +
                ", birthDate='" + birthDate + '\'' +
                ", age=" + age +
                ", mobile='" + mobile + '\'' +
                '}';
    }
}
